//
//  RootViewController.m
//  Malena
//
//  Created by Dawn on 12-11-3.
//  Copyright (c) 2012年 Dawn. All rights reserved.
//

#import "RootViewController.h"
#import "PhotoListViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void) dealloc{
    [super dealloc];
}

- (void)viewDidLoad{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    photoListVC = [[PhotoListViewController alloc] init];

    if (IOSVersion_5) {        
        [self presentViewController:photoListVC animated:NO completion:nil];
        [photoListVC release];
    }else{
        [self.view addSubview:photoListVC.view];
    }
}
- (void) viewDidUnload{

}

- (void)didReceiveMemoryWarning{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - 
#pragma mark UIViewControllerRotation

// 支持旋转
- (BOOL)shouldAutorotate{
    return YES;
}

// 支持所有的方向
- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskAll;
}

-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
	return YES;
}


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    
    [UIView beginAnimations:@"Scroll" context:nil];
    [UIView setAnimationDuration:duration];
    switch (toInterfaceOrientation) {
        case UIInterfaceOrientationLandscapeLeft:{
            
        }
        case UIInterfaceOrientationLandscapeRight:{
            //splashView.frame = CGRectMake(0, 0, SCREEN_HEIGHT, SCREEN_WIDTH);
            break;
        }
        case UIInterfaceOrientationPortrait:{
            
        }
        case UIInterfaceOrientationPortraitUpsideDown:{
           // splashView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
            break;
        }
        default:
            break;
    }
    [UIView commitAnimations];
}

@end
